<?php

	$dir = pathinfo($_SERVER['SCRIPT_FILENAME']); 

	if (ini_set("include_path",ini_get("include_path").((strtoupper(PHP_OS) == "LINUX") ? ":" : ";").$dir['dirname']) === false) {
		echo "ERROR: Definicion en el include_path";
		exit;
	}

	include('../adodb/adodb.inc.php');
	include_once('../adodb/adodb-pager.inc.php');
	include_once('../conf/dbconn_param.php');
	
	
	$db = ADONewConnection($dbdriver);
	$db->Connect($server, $user, $password, $database);
	$db->SetFetchMode(ADODB_FETCH_ASSOC);

  	$db->debug = false;

	$predId = $_REQUEST["id"];
	$operType = $_REQUEST["oper"]; //tipo de operacion


	switch ($operType) {
		case "del":
			  	$sql = "delete from prepacking where prep_id =$predId";	
			  	$rs = $db->Execute($sql);
			break;
		case "edit":
				if( $predId > 0 )
				{
					$sql = "delete from prepacking where prep_id =$predId";	
					$rs = $db->Execute($sql);
				}
		    break;
		// default:
		// 	echo "lock";
	}

	
	 $db->Close;
?>	